package org.wqp.redisson.main;

import org.redisson.api.RLock;
import org.wqp.redisson.utils.RedissonUtil;

public class RlockTest {
    public static void main(String[] args) {
        System.out.println("main start");
        RLock lock = RedissonUtil.getRedissonClient().getLock("RLock");
        MyTask task1 = new MyTask(lock);

       Thread t1 =  new Thread(task1, "01");
        Thread t2 =  new Thread(task1, "02");
        t1.start();
        t2.start();

        try {
            t1.join();
            t2.join();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        System.out.println("main end");
    }
}
